<template>
    <div class="table">
        <div class="btn">
            <div class="btn_item" @click="pushAdd">
                <img class="btn_icon" src="@/assets/images/images_new/add_icon.png" alt="">
                <span>新增</span>
            </div>
            <div class="btn_item" @click="pushTeamConfig">
                <img class="btn_icon" src="@/assets/images/images_new/add_icon.png" alt="">
                <span>班组配置</span>
            </div>
            <div class="btn_item" @click="showTemplate">
                <img class="btn_icon" src="@/assets/images/images_new/del_icon.png" alt="">
                <span>排班模板</span>
            </div>
        </div>
        <div class="tableBg">
            <el-table ref="tableRef" :data="tableData.list" style="width: 100%;" stripe empty-text="暂无数据"
                :max-height="table_height" :scrollbar-always-on="true">
                <el-table-column property="name" label="班组成员姓名" width="96px" />
                <el-table-column property="day01" label="1" min-width="45" align="center" />
                <el-table-column property="day02" label="2" min-width="45" align="center" />
                <el-table-column property="day03" label="3" min-width="45" align="center" />
                <el-table-column property="day04" label="4" min-width="45" align="center" />
                <el-table-column property="day05" label="5" min-width="45" align="center" />
                <el-table-column property="day06" label="6" min-width="45" align="center" />
                <el-table-column property="day07" label="7" min-width="45" align="center" />
                <el-table-column property="day08" label="8" min-width="45" align="center" />
                <el-table-column property="day09" label="9" min-width="45" align="center" />
                <el-table-column property="day10" label="10" min-width="45" align="center" />
                <el-table-column property="day11" label="11" min-width="45" align="center" />
                <el-table-column property="day12" label="12" min-width="45" align="center" />
                <el-table-column property="day13" label="13" min-width="45" align="center" />
                <el-table-column property="day14" label="14" min-width="45" align="center" />
                <el-table-column property="day15" label="15" min-width="45" align="center" />
                <el-table-column property="day16" label="16" min-width="45" align="center" />
                <el-table-column property="day17" label="17" min-width="45" align="center" />
                <el-table-column property="day18" label="18" min-width="45" align="center" />
                <el-table-column property="day19" label="19" min-width="45" align="center" />
                <el-table-column property="day20" label="20" min-width="45" align="center" />
                <el-table-column property="day21" label="21" min-width="45" align="center" />
                <el-table-column property="day22" label="22" min-width="45" align="center" />
                <el-table-column property="day23" label="23" min-width="45" align="center" />
                <el-table-column property="day24" label="24" min-width="45" align="center" />
                <el-table-column property="day25" label="25" min-width="45" align="center" />
                <el-table-column property="day26" label="26" min-width="45" align="center" />
                <el-table-column property="day27" label="27" min-width="45" align="center" />
                <el-table-column property="day28" label="28" min-width="45" align="center" />
                <el-table-column property="day29" label="29" min-width="45" align="center" />
                <el-table-column property="day30" label="30" min-width="45" align="center" />
                <el-table-column property="day31" label="31" min-width="45" align="center" />

            </el-table>
        </div>
    </div>
</template>

<script setup lang="ts">
import router from '@/routes';


let tableData = reactive({
    list: [
        { name: '张三', day01: '09:00-10:00', day02: '', day03: '', day04: '', day05: '', day06: '', day07: '9:00-10:00', day08: '', day09: '', day10: '', day11: '', day12: '', day13: '', day14: '', day15: '', day16: '', day17: '', day18: '', day19: '', day20: '', day21: '', day22: '', day23: '', day24: '', day25: '', day26: '', day27: '', day28: '', day29: '', day30: '', day31: '' },
        { name: '张三', day01: '', day02: '', day03: '', day04: '', day05: '', day06: '', day07: '', day08: '', day09: '', day10: '', day11: '', day12: '', day13: '', day14: '', day15: '', day16: '', day17: '', day18: '', day19: '', day20: '', day21: '', day22: '', day23: '', day24: '', day25: '', day26: '', day27: '', day28: '', day29: '', day30: '', day31: '' },
        { name: '李四', day01: '9:00-10:00', day02: '', day03: '', day04: '', day05: '', day06: '', day07: '9:00-10:00', day08: '', day09: '', day10: '', day11: '', day12: '', day13: '', day14: '', day15: '', day16: '', day17: '', day18: '', day19: '', day20: '', day21: '', day22: '', day23: '', day24: '', day25: '', day26: '', day27: '', day28: '', day29: '', day30: '', day31: '' },
        { name: '王五', day01: '9:00-10:00', day02: '', day03: '', day04: '', day05: '', day06: '', day07: '9:00-10:00', day08: '', day09: '', day10: '', day11: '', day12: '', day13: '', day14: '', day15: '', day16: '', day17: '', day18: '', day19: '', day20: '', day21: '', day22: '', day23: '', day24: '', day25: '', day26: '', day27: '', day28: '', day29: '', day30: '', day31: '' },
        { name: '王五', day01: '9:00-10:00', day02: '', day03: '', day04: '', day05: '', day06: '', day07: '9:00-10:00', day08: '', day09: '', day10: '', day11: '', day12: '', day13: '', day14: '', day15: '', day16: '', day17: '', day18: '', day19: '', day20: '', day21: '', day22: '', day23: '', day24: '', day25: '', day26: '', day27: '', day28: '', day29: '', day30: '', day31: '' },
    ]
})
let table_height = ref(500)

//跳转新增页面
const pushAdd = () => {
    router.push('/integratedServices/addDaily');
}

let emit = defineEmits(['showTemplate']);

const showTemplate = () => {
    emit('showTemplate');
}

//跳转班组配置页面
const pushTeamConfig = ()=>{
    router.push('/integratedServices/teamConfig_daily');
}
</script>

<style lang="scss" scoped>
.table {
    height: calc(100% - 183px);

    .btn {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        height: 40px;
        padding-right: 25px;
        color: rgb(112, 105, 95);
        font-size: 14px;

        .btn_item {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
            height: 28px;
            line-height: 28px;
            padding: 0 10px 0 8px;

            &:hover {
                background: rgba(0, 0, 0, 0.1);
                border-radius: 2px;
            }

            .btn_icon {
                width: 18px;
                margin-right: 6px;
            }
        }
    }

    .tableBg {
        background-color: #fff;
        border-radius: 8px;
        height: calc(100% - 40px);
        overflow: hidden;

        :deep(.el-table) {
            .el-table__cell {
                border-right: 1px solid rgba(0, 0, 0, 0.15);
                border-bottom: 1px solid rgba(0, 0, 0, 0.15);

                .cell {
                    white-space: wrap;
                    height: auto;
                    padding: 0 5px;
                    line-height: 30px;
                    min-height: 50px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                }
            }
        }
    }
}
</style>
